
package code.codeworld.common.dict.controller;


import code.codeworld.common.dict.model.Dict;
import code.codeworld.common.dict.model.vo.DictVo;
import code.codeworld.common.dict.service.DictService;
import code.codeworld.common.kits.Request;
import code.codeworld.common.kits.Result;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * world控制器
 *
 * @author freecode
 * @date 2023/03/23 00:20
 */
@CrossOrigin
@RequestMapping(Request.CODEWORLD_WEB)
@RestController
public class DictCtl {
    @Resource
    private DictService dictService;


    /**
     * 获取Dict集合
     *
     * @author freecode
     * @date 2023/03/23 00:20
     */
    @GetMapping("dict/list")
    public Result<List<Dict>> list(DictVo dictVo) {
        return dictService.list(dictVo);
    }

    /**
     * 获取Dict详情
     *
     * @author freecode
     *
     * @date 2023/03/23 00:20
     */
    @CrossOrigin
    @GetMapping("dict/detail")
    public Result<Dict> detail(Dict dict) {
        return dictService.detail(dict);
    }

}
